<?php
$myDir = dirname(__FILE__) . "/";
require_once($myDir."../autoload.php");

if ( $argc == 1 || $argv[1] == "--help" ) {
  die( "\n\tUsage: php ".$argv[0]." [DATA_OBJECT_CLASS] [NEW_SCAFFOLDER_NAME] [PATH_TO_PROJECT] [opt:BASE_SCAFFOLDER]\n\n");  
}


$className = $argv[1];
$newSF     = $argv[2];
$path      = $argv[3];
$baseSF    = ($argc >= 5) ? $argv[4] : 'SimpleTableScaffolder';

require_once($path . "user_autoload.php");

ScaffolderGenerator::materialize(Scaffolder::wrap(new $className(), $baseSF), $newSF, $path);
WebUtils::addScaffolderToGenAutoload($newSF, $path);